"""
# -*- coding: utf-8 -*-
# @Time    : 2023/5/21 22:24
# @Author  : 王摇摆
# @FileName: Plot.py
# @Software: PyCharm
# @Blog    ：https://blog.csdn.net/weixin_44943389?type=blog
"""
import numpy as np
import matplotlib.pyplot as plt
from SVM.SVM3.Test.Funciton import X,y,a,b

plt.rcParams['font.sans-serif'] = ['PingFang HK']  # 选择一个本地的支持中文的字体
fig, ax = plt.subplots()
ax.set_facecolor('#f8f9fa')

x1 = X[y==-1][:, 0]
y1 = X[y==-1][:, 1]
x2 = X[y==1][:, 0]
y2 = X[y==1][:, 1]
p1 = plt.scatter(x1, y1, c='#e63946', marker='o', s=20)
p2 = plt.scatter(x2, y2, c='#457b9d', marker='x', s=20)

theta = np.arange(0, 2 * np.pi, np.pi / 100)
p3, = plt.plot(a * np.cos(theta), b * np.sin(theta), color='#38b000')

ax.set_xlabel('X1', color='#264653')
ax.set_ylabel('X2', color='#264653')
ax.tick_params(labelcolor='#264653')
plt.legend([p1, p2, p3], ["-EXP1", "EXP1", "φ"], loc="upper right")
plt.show()
